<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title></title>
	<script type="text/javascript" src="<%=basePath%>js/common/global/png.js"></script>
 	<script type="text/javascript" src="<%=basePath %>ajaxFramework/jQuery/jquery.js"></script>
 	<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/ext-all.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=basePath %>ajaxFramework/ext-2.1/resources/css/ext-all.css" />
    
	<script language="javascript">
	if(document.addEventListener){//如果是Firefox
		document.addEventListener("keypress",fireFoxHandler, true);
	}else{
		document.attachEvent("onkeypress",ieHandler);
	}
	function fireFoxHandler(evt){
		//alert("firefox");
		if(evt.keyCode==13){
		   submitform1();
		}
	}
	function ieHandler(evt){
		//alert("IE");
		if(evt.keyCode==13){
		   submitform1();
		}
	}
	</script>
	<script type="text/javascript">
	function SetCookie(name,value)//两个参数，一个是cookie的名子，一个是值
	{
	    var Days = 30; //此 cookie 将被保存 30 天
	    var exp  = new Date();    //new Date("December 31, 9998");
	    exp.setTime(exp.getTime() + Days*24*60*60*1000);
	    document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
	}
	function getCookie(name)//取cookies函数        
	{
	    var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
	     if(arr != null) return unescape(arr[2]); return null;
	}
	function delCookie(name)//删除cookie
	{
	    var exp = new Date();
	    exp.setTime(exp.getTime() - 1);
	    var cval=getCookie(name);
	    if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
	}
	function submitform1(){
		var loginName = document.form1.loginName.value;
		var password = document.form1.password.value;
		if(loginName == '' || password == ''){
			alert('请输入登录名及密码！');
		}else{
			var namettt=document.getElementById('loginName').value;
			if(document.form1.baocun.checked){
				SetCookie('name',namettt);
			}else{
				delCookie('name');
			}
			if(document.form1.tan.checked){
				document.form1.tanchu.value='true';
			}else{
				document.form1.tanchu.value='no';
			}
			document.form1.submit();
		}
	}
	
	$(document).ready(function()
	{
		<%if(null!=request.getAttribute("login")){%>
			Ext.get('mb8').on('click', function(){
	        	Ext.MessageBox.alert('提示信息', '您输入的用户名或密码不正确.', showResult);
	    	});
		    function showResult(btn){
				$('#loginName').focus();
		    };
		    $('#mb8').click();
		<%}%>
		if(document.getElementById('loginName').value!=''){
			$('#password').focus();
		}else{
			$('#loginName').focus();
		}
	});
	</script>
	<link href="<%=basePath%>style/system.css" rel="stylesheet" type="text/css" id="txlk6"/>
	<style type="text/css">
		.hoverbox{width:191px;height:36px;}
		.b1{background:url(<%=basePath %>images/button_01.gif) no-repeat;cursor:hand;height:36px;width:191px;}
		.b1 a:hover{background:url(<%=basePath %>images/button_02.gif) no-repeat;cursor:hand;height:36px;width:191px;}
		#container01{background:url(images/bg690.gif) repeat-x;width:100%; height:690px;}
	</style>
  </head>
  
  <body>
<div id="container01">
    <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" class="container_tab">
      <tr height="8%">
        <td class="registerword02" align="left">
        <div class="png" style="width:302px;height:34px;background-image:url(images/load12.gif);background-repeat:no-repeat"/>        </td>
        <td class="registerword02" align="center">&nbsp;</td>
        <td class="registerword02" align="right"><a style="cursor: hand" onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('<%=basePath 
%>')">设为首页</a> | <a href="http://www.zhonghuan.com" target="_blank">集团公司网站</a></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="87%" width="62%" align="center">
        <div class="png" style="width:447px;height:359px;background-image:url(images/logo.gif);background-repeat:no-repeat"/></td>
        <td width="1%" align="center">
        <div class="png" style="width:4px;height:487px;background-image:url(images/line_01.gif);background-repeat:no-repeat"/></td>
        <td colspan="2">
        	<form action="<%=basePath %>tjsinfo/tjsoa/system/login.do" name="form1" method="post">
               <table width="278" height="134" border="0" cellpadding="0" cellspacing="0" class="registertab">
                <tr>
                  <td height="32" colspan="2" class="registerword01">用户名:</td>
                  <td width="218">
                  <input name="loginName" id="loginName" type="text" size="20" class="textinput"/></td>
                </tr>
                <tr>
                  <td height="32" colspan="2" class="registerword01">密&nbsp;&nbsp;码:</td>
                  <td width="218"><input id="password" name="password" type="password" size="20" class="textinput" style="width: 133"/></td>
                </tr>
                  <td width="278" height="39" align="left" class="registerword02" colspan="3"><input type="checkbox" name="baocun" value="checkbox" 
onselect="baocun();"/>下次登录保留用户名<button id="mb8" style="display:none"></button>
                  &nbsp;<input type="checkbox" name="tan"/>弹出模式
                  <input type="hidden" name="tanchu" value=""/>
                  </td>
                <tr>
                  <td colspan="3" height="31"><span class="b1"><a href="javaScript:submitform1();"><span class="hoverbox"></span></a></span></td>
                </tr>
              </table>
             </form>       
          </td>
      </tr>
      <tr>
        <td colspan="4" class="registerword02" align="center" height="5%"><span style="font-family:Arial">
Copyright &copy; 2008 The Electronic Computer Institute of Tianjin.All right reserved.</span>&nbsp;&nbsp;&nbsp;天津市电子计算机研究所研发中心 技术支持
&nbsp;&nbsp;&nbsp;服务热线：86-022-28356729</td>
      </tr>
  </table>
</div>
<script type="text/javascript">
var cName=getCookie('name');
	if(cName==null || cName.length==0){
		cName='';
	}else{
		document.form1.baocun.checked = true;
	}
	document.form1.loginName.value=cName;
pngHandler.init();
</script>
  </body>
</html>
